package methodTest

import "fmt"

type Usb interface {
	Start()
	Stop()
}
type Usb02 interface {
	Start02()
	Stop02()
}
type Phone struct {
}
type Camera struct {
}

func (p Phone) Start() {
	fmt.Println("Phone开始工作")
}

func (p Phone) Stop() {
	fmt.Println("Phone停止工作")
}
func (p Phone) Start02() {
	fmt.Println("Phone开始工作")
}

func (p Phone) Stop02() {
	fmt.Println("Phone停止工作")
}
func (p Camera) Start() {
	fmt.Println("Camera开始工作")
}

func (p Camera) Stop() {
	fmt.Println("Camera停止工作")
}

type Computer struct {
}

func (com *Computer) Working(usb Usb) {
	usb.Start()
	usb.Stop()
}

func UsbTest() {
	/*var usb Usb*/

	/*	computer := Computer{}
		phone := Phone{}
		camera := Camera{}
		usb = phone
		usb.Start()
		usb.Stop()
		computer.Working(phone)
		computer.Working(camera)*/
	phone := Phone{}
	var one Usb
	var two Usb02
	one = phone
	two = phone
	one.Start()
	one.Stop()
	two.Start02()
	two.Stop02()
}
